package sf.view;

import java.awt.Component;

import javax.swing.JOptionPane;

import sf.model.Context;

public class StandardFormFactory {
	
	private StandardFormFactory() {}
	
	public static void createAndShow(Context context, Component parent) {
		StandardForm dialog = new StandardForm(context, JOptionPane.getFrameForComponent(parent));
    	dialog.setLocationRelativeTo(null);
    	dialog.setVisible(true);
	}
	
	public static void createAndShow(String tabela, Component parent) {
		Context context = new Context(null, StandardForm.MODE_EDIT | StandardForm.FROM_MENU, tabela);
		StandardForm dialog = new StandardForm(context, JOptionPane.getFrameForComponent(parent));
    	dialog.setLocationRelativeTo(null);
    	dialog.setVisible(true);
	}
}